﻿using System;
using System.Web.Services;
using Dost.Khcn.Biz;

namespace Dost.Khcn.Web.ChuyenGia
{
    public partial class QuaTrinhCongTac : System.Web.UI.Page
    {
        #region Properties

        private static QuaTrinhCongTacBiz _qaQuaTrinhCongTacBiz;
        private static QuaTrinhCongTacBiz QuaTrinhCongTacManager
        {
            get
            {
                return (_qaQuaTrinhCongTacBiz ?? (_qaQuaTrinhCongTacBiz = new QuaTrinhCongTacBiz()));
            }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession = true)]
        public static object List(int chuyenGiaId)
        {
            var results = QuaTrinhCongTacManager.GetQuaTrinhCongTacs(chuyenGiaId);
            return new { Result = "OK", Records = results };
        }

        [WebMethod(EnableSession = true)]
        public static object Create(Data.EntityModel.QuaTrinhCongTac record)
        {
            var addedRecord = QuaTrinhCongTacManager.Create(record);
            return new { Result = "OK", Record = addedRecord };
        }

        [WebMethod(EnableSession = true)]
        public static object Update(Data.EntityModel.QuaTrinhCongTac record)
        {
            QuaTrinhCongTacManager.Update(record);
            return new { Result = "OK" };
        }

        [WebMethod(EnableSession = true)]
        public static object Delete(int Id)
        {
            QuaTrinhCongTacManager.Delete(Id);
            return new { Result = "OK" };
        }
    }
}